<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .parent1 {
            background-color: plum;
        }

        .child1{
            width: 100px;
            background-color: blue;
            margin: 0 auto;
        }
    </style>
</head>

<body>
    <div class="parent1">
        <div class="child1">1.0  margin:0 auto; 的方式块级元素水平居中</div>
    </div>

    
</body>
</html>